import { createRouter, createWebHashHistory } from 'vue-router'

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      name: 'home',
      component: () => import('@/views/templateList/index.vue'),
      meta: {
        headerVisible: true,
        footerVisible: true,
        disabledGlobalLoading: false, //禁用全局loading
        title: '欢迎来到lego编辑器',
        visibilityBanner: true,
      },
    },
    {
      path: '/template/:id',
      name: 'template',
      component: () => import('@/views/detail/index.vue'),
      meta: {
        headerVisible: true,
        footerVisible: true,
        title: '模板详情',
        disabledGlobalLoading: false,
      },
    },
    {
      path: '/editor/:id',
      name: 'editor',
      component: () => import('@/views/editdocter/index.vue'),
      meta: {
        headerVisible: true,
        footerVisible: false,
        title: '编辑器',
        disabledGlobalLoading: false,
      },
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/login/index.vue'),
      meta: {
        headerVisible: false,
        footerVisible: false,
        disabledGlobalLoading: true, //禁用全局loading
        title: '登录到lego编辑器',
      },
    },
    {
      path: '/myWork',
      name: 'myWork',
      component: () => import('@/views/work-list/work-list.vue'),
      meta: {
        headerVisible: true,
        footerVisible: true,
        disabledGlobalLoading: true, //禁用全局loading
        title: '我的作品',
      },
    },
  ], //路由表
})

export default router
